home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
basic
/
imb9108.zip
/
PROGRAM3.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-06-19
|
2KB
|
71 lines
DECLARE SUB PAUSE ()
DEFINT A-Z
'*******************************************************************
'* PROG2.BAS = = Program to test new combined library files *
'* First test the Call interrupt mechanism *
'* Then test the date/time library routines *
'*******************************************************************
'The next two instructions include the header files for the individual
'libraries. You could combine the contents of the two include files
'into a single lib file named something like 2NDLIB.BI
'$INCLUDE: 'QBX.BI'
'$INCLUDE: 'DATIM.BI'
DIM Regs AS RegType 'Registers for CALL Interrupt
CLS
'==================== TEST CALL INTERRUPT =============================
PRINT "Testing to see if the CALL Interrupt routine is available"
PRINT
'We just chose a miscellaneous funtion (&H1B) of interrupt (&H21)
' to test that the CALL Interrupt routine appears in our new library
Regs.AX = &H1B00 'Setup the interrupt call to
CALL Interrupt(&H21, Regs, Regs) 'Get default drive data
AL = Regs.AX AND (&HFF) 'Get lower byte of AX register
IF AL <> &HFF THEN 'If not an error from interrupt
SectorsPerCluster& = AL ' process the results
BytesPerSector& = Regs.CX
NumberofClusters& = Regs.DX
IF NumberofClusters& < 0 THEN 'Handle overflow for large disks
NumberofClusters& = NumberofClusters& + 65536
END IF
'Print results
NbrBytes& = SectorsPerCluster& * BytesPerSector& * NumberofClusters&
PRINT USING "Sectors per cluster = ##"; SectorsPerCluster&
PRINT USING "Bytes per sector = #,###"; BytesPerSector&
PRINT USING "Number of clusters = ###,###"; NumberofClusters&
PRINT " -----------"
PRINT USING "Nbr of bytes on disk = ###,###,###"; NbrBytes&
ELSE
PRINT "Error during interrupt."
END IF
PRINT : PAUSE
'============== TEST POSPRINT ROUTINE ================================
CLS
PRINT "Test to make sure the date/time library is available"
PRINT "The current time is "; Now#
PRINT : PAUSE
END
SUB PAUSE
PRINT "Press any key...."
WHILE LEN(INKEY$) = 0: WEND
END SUB